package com.lanou.elh.sysmanage.authority_management.service.impl;

import com.lanou.elh.sysmanage.authority_management.entity.Log;
import com.lanou.elh.sysmanage.authority_management.mapper.LogMapper;
import com.lanou.elh.sysmanage.authority_management.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    @Override
    public List<Log> selectAllLog() {
      return logMapper.selectAllLog();
    }

    @Override
    public boolean deleteOneLog(Integer id) {
        Integer integer = logMapper.deleteLog(id);
        if (integer>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean deleteManyLog(Integer[] id) {
        for (int i = 0; i < id.length; i++) {
            logMapper.deleteLog(id[i]);
        }
        return true;
    }

    @Override
    public List<Log> selectLogByTerm(String param) {

        return logMapper.selectLogByTerm(param);
    }
}
